home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 June / Ahoy_Magazine_88-06_1988_Double_L.d64 / Dutchman's Mine (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  7KB  |  198 lines

  1. 10 rem lost dutchman's mine
  2. 20 rem by cleveland m. blakemore
  3. 30 rem runs on all commodore computers
  4. 40 rem with 40 columns and petascii
  5. 50 rem lock in uppercase & clear screen
  6. 60 printchr$(8)chr$(142)chr$(147)
  7. 70 rem print title screen
  8. 80 print""tab(10)"lost dutchman's mine"
  9. 90 printtab(10)"* all c= computers *":printtab(14)"(c)1988 cmb"
  10. 100 printtab(8)"by cleveland m. blakemore"
  11. 110 rem initialize arrays and variables
  12. 120 dim v$(32),n$(20),l$(9),s$(9),d(9,6),o(9,8),i(8),d$(8),m$(4)
  13. 130 rem variables and flags
  14. 140 rem cl=current location
  15. 150 dim cl,wingame,weight,dead,alive,wolf,ghost,full,empty,river,mound,count
  16. 160 alive=1:dead=0:wolf=alive:spirit=alive
  17. 170 full=1:empty=0:river=empty:mound=full:count=0
  18. 180 rem read locations & descriptions
  19. 190 forx=.to9:readl$(x):next:forx=.to9:reads$(x):next
  20. 200 rem read in directions
  21. 210 forx=1to9:ford=1to6:readd(x,d):nextd,x
  22. 220 forx=1to32:readv$(x):next:forx=1to20:readn$(x):next
  23. 230 forx=.to8:readd$(x):next
  24. 240 readx,d:ifx=-1then260
  25. 250 o(x,d)=1:goto240
  26. 260 forx=.to4:readm$(x):next
  27. 270 rem wait for return key press
  28. 280 printtab(8)"press return to continue"
  29. 290 geta$:on-(a$<>chr$(13))goto290
  30. 300 rem start off at gas station
  31. 310 cl=.:gosub730
  32. 320 rem parser main routines
  33. 330 rem get command
  34. 340 in$="":v=.:n=.
  35. 350 input"command>";in$:ifin$=""thenprint"silence is golden.":goto350
  36. 360 rem parse verb
  37. 370 iflen(in$)>1then450
  38. 380 v=.:forx=1to7:ifin$=v$(x)thenv=x
  39. 390 next:ifv=.thenprint"what does that mean?":goto600
  40. 400 ifv=7thengosub880:goto600
  41. 410 on-(cl=6and(v=1orv=6)andweight>1)goto420:goto430
  42. 420 print"you are carrying too much to fit throughthe crack.":goto600
  43. 430 ifd(cl,v)thencl=d(cl,v):gosub730:goto600
  44. 440 print"you can't go that way!":goto600
  45. 450 v=.:forx=8to13:ifin$=v$(x)thenv=x
  46. 460 next:ifvthenv=v-7:goto410
  47. 470 v=.:forx=14to32:ifleft$(in$,len(v$(x)))=v$(x)thenv=x:d=len(v$(x))
  48. 480 next:ifv=.thenprint"i don't know that verb!":goto600
  49. 490 rem parse noun
  50. 500 x=len(in$):ifx=dthen570
  51. 510 ifmid$(in$,d,1)<>chr$(32)andd<xthend=d+1:goto510
  52. 520 ifd=xthen570
  53. 530 d=d+1:n=.:forx=1to20:ifmid$(in$,d,len(n$(x)))=n$(x)thenn=x
  54. 540 next:ifn=.thenprintv$(v)" what?!?":goto600
  55. 550 rem jump to appropriate subroutine
  56. 560 rem based on value in "v"
  57. 570 ifv<23thenonv-13gosub880,880,920,970,970,1030,1030,1100,1160:goto600
  58. 580 onv-22gosub1210,1210,1280,1310,1310,1310,1370,1370,1450,1450
  59. 590 rem check flags and counters
  60. 600 ifwingamethenx=.:goto700
  61. 610 ifcl=3andspirit=alivethencl=4:gosub730:print"the spirit scares you back!!"
  62. 620 ifcl=9andriver=emptythencl=7:gosub730:print"the room below is underwater."
  63. 630 ifriver=fullandcl=8andcount>0thenx=1:goto700
  64. 640 ifwolf=aliveandcl=7andcount>1thenx=2:goto700
  65. 650 ifspirit=aliveandcl=4andcount>4thenx=3:goto700
  66. 660 ifspirit=aliveandcl=4andcount>2thenprint"the spirit looks real angry!"
  67. 670 if((cl>1andcl<4)orcl>5)andi(0)>-1andcount>2andrnd(0)>.5thenx=4:goto700
  68. 680 count=count+1
  69. 690 goto340
  70. 700 print:printm$(x):ifxthenprint"sorry, you have died..."
  71. 710 end
  72. 720 rem print location
  73. 730 count=0
  74. 740 printchr$(147);
  75. 750 if((cl>1andcl<4)orcl>5)andi(0)>-1thenprint"it's pitch dark in here!":return
  76. 760 print"you are":printl$(cl)
  77. 770 rem print available directions
  78. 780 print"directions:";
  79. 790 d=.:forx=1to6:ifd(cl,x)thenprintv$(7+x);",";:d=x
  80. 800 next:ifd=.thenprint"none."
  81. 810 ifdthenprint"[157]."
  82. 820 rem print objects at location
  83. 830 print"you can now see:":ifs$(cl)>""thenprints$(cl)
  84. 840 d=.:forx=.to8:ifo(cl,x)thenprintd$(x):d=1
  85. 850 next:ifd=.ands$(cl)=""thenprint"nothing."
  86. 860 return
  87. 870 rem load/inventory
  88. 880 print"you are carrying:":d=.:forx=.to8:ifi(x)thenprintd$(x):d=1
  89. 890 next:ifd=.thenprint"nothing."
  90. 900 return
  91. 910 rem gozer
  92. 920 ifcl=.thencl=1:goto950
  93. 930 ifcl=1thencl=.:goto950
  94. 940 print"nothing happens here.":return
  95. 950 gosub730:return
  96. 960 rem take/get
  97. 970 ifn=.thenprint"get what?!?":return
  98. 980 ifn>9thenprint"you can't get that!":return
  99. 990 ifi(n-1)thenprint"you already have it!":return
  100. 1000 ifo(cl,n-1)theni(n-1)=o(cl,n-1):o(cl,n-1)=.:print"ok,taken.":goto1070
  101. 1010 print"it's not here!":return
  102. 1020 rem drop/put
  103. 1030 ifn>9thenprint"you must be confused.":return
  104. 1040 ifi(n-1)=.thenprint"you don't have it!":return
  105. 1050 o(cl,n-1)=i(n-1):i(n-1)=0:print"okay, dropped."
  106. 1060 ifo(0,5)ando(0,7)ando(0,8)thenwingame=1
  107. 1070 weight=0:forx=.to8:ifi(x)thenweight=weight+1
  108. 1080 next:return
  109. 1090 rem light
  110. 1100 ifi(1)=.thenprint"no matches.":return
  111. 1110 ifn<>1thenprint"you're a pyromaniac!":return
  112. 1120 ifi(.)=.thenprint"you don't have it!":return
  113. 1130 ifi(.)=-1thenprint"it's already burning.":return
  114. 1140 i(.)=-1:gosub730:print"okay, it's burning.":return
  115. 1150 rem dig
  116. 1160 ifcl<>9orn<>15thenprint"try it somewhere else.":return
  117. 1170 ifmound=emptythenprint"the mound has already been excavated.":return
  118. 1180 o(9,8)=1:mound=empty:gosub730
  119. 1190 print"okay, you have dug a deep hole...":return
  120. 1200 rem shoot/kill
  121. 1210 ifi(3)=.thenprint"you don't have the "n$(4)"ver.":return
  122. 1220 ifi(6)=.thenprint"you don't have the "n$(7)"ts.":return
  123. 1230 ifn<>13andn<>14thenprint"you're crazy.":return
  124. 1240 ifcl<>7thenprint"it's not here.":return
  125. 1250 wolf=dead:print"the revolver thunders fire and the wolf falls over dead";
  126. 1260 print"in mid-leap.":s$(7)="a dead timber wolf":return
  127. 1270 rem say
  128. 1280 ifn=10then920
  129. 1290 print"nothing happens.":return
  130. 1300 rem turn/rotate/twist
  131. 1310 ifcl<>8orn<>18thenprint"interesting concept...":return
  132. 1320 river=full:print"the door blasts open with a tidal wave  of water!!!"
  133. 1330 print"the river bed quickly fills up and youare drenched."
  134. 1340 print"you'd better leave. it's almost neckdeep in here!"
  135. 1350 s$(8)="bubbles coming out of your clenched lipsunderwater":count=0:return
  136. 1360 rem blow/whist
  137. 1370 ifn=.thenprint"tweet tweet tweet..."
  138. 1380 ifcl=4andn=.thenprint"the spirit trembles and wavers a little.":return
  139. 1390 ifn<>5thenprint"that's ridiculous!":return
  140. 1400 ifi(n-1)=.thenprint"you don't have it!":return
  141. 1410 ifcl<>4thenprint"nothing happens.":return
  142. 1420 spirit=dead:print"the spirit writhes and vanishes in acloud of smoke!"
  143. 1430 s$(4)="":return
  144. 1440 rem look/examine
  145. 1450 ifn=.thengosub740:return
  146. 1460 ifn<10thenifi(n-1)=.thenprint"you don't have it!":return
  147. 1470 ifn=2thenprint"gozer travel inc.'need to travel?? call gozer!!'":return
  148. 1480 ifcl=2andn=12thenprint"his bony claw points to the east...":return
  149. 1490 ifcl=0andn=19thenprint" put all the treasure on this shelf ":return
  150. 1500 ifn=1andi(0)=-1thenprint"it's burning.":return
  151. 1510 ifn=1andi(0)=1thenprint"it's out.":return
  152. 1520 print"you see nothing out of the ordinary.":return
  153. 1530 rem locations
  154. 1540 data in a deserted last chance gas station
  155. 1550 data"in a dusty adobe house with a sunbeamcoming through an east window"
  156. 1560 data in a long e-w mineshaft,in a sloping granite tunnel
  157. 1570 data in front of an old boarded up mineshaft entrance,in a deep ravine
  158. 1580 data inside a cool cavern with a small crack leading down to the north
  159. 1590 data on a spiral stone staircase
  160. 1600 data in a subterranean river bed running east & west
  161. 1610 data in an ancient indian burial ground
  162. 1620 rem specific observations
  163. 1630 data a metal plaque above a glass shelf,a skull mounted on a spear
  164. 1640 data a skeleton draped with cobwebs,"",a whistling evil spirit
  165. 1650 data "",a colossal stone sun calendar,a ravenous snarling timber wolf!
  166. 1660 data a circular wheel set in the middle of aniron door to the east
  167. 1670 data a large burial mound
  168. 1680 rem directions
  169. 1690 rem  n,s,e,w,u,d
  170. 1700 data 4,0,0,0,0,0
  171. 1710 data 0,0,6,7,3,0
  172. 1720 data 0,0,0,0,4,2
  173. 1730 data 3,1,0,5,0,0
  174. 1740 data 0,0,4,0,0,0
  175. 1750 data 8,0,0,2,0,8
  176. 1760 data 0,0,2,0,2,9
  177. 1770 data 0,6,0,8,6,0
  178. 1780 data 0,0,0,0,7,0
  179. 1790 rem verbs
  180. 1800 data n,s,e,w,u,d,i,north,south,east,west,up,down,load,inven,gozer,take
  181. 1810 data get,drop,put,light,dig,shoot,kill,say,turn,rotat,twist,blow,whist
  182. 1820 data look,examine
  183. 1830 rem nouns
  184. 1840 data torch,match,shove,revol,bottl,diamo,bulle,ruby,nugge,gozer
  185. 1850 data skull,skele,wolf,timb,mound,calen,spiri,wheel,plaqu,shelf
  186. 1860 rem descriptions
  187. 1870 data a wooden torch,a matchbook,a rusty shovel
  188. 1880 data a pearl handled revolver,an empty 7-up bottle
  189. 1890 data a glowing diamond,a handful of rusty bullets,a lustrous red ruby
  190. 1900 data the dutchman's nugget
  191. 1910 rem objects & initial locations
  192. 1920 data 0,1,0,3,0,4,1,0,5,2,2,6,3,7,8,5,-1,-1
  193. 1930 rem end of game messages
  194. 1940 data congratulations! you've won the game!
  195. 1950 data you drowned in the river.,the timber wolf tears you to shreds.
  196. 1960 data the evil spirit sucked the breath out of you!
  197. 1970 data you fell down in the dark and broke your neck!
  198.